* When does accommodation fail? The electoral consequences of intra-party divisions and mainstream party strategies
* Felix Lehmann
* Department of Political Science, University of Gothenburg
* felix.lehmann@gu.se; Sprängkullsgatan 19, Box 711, 411 23 Göteborg, Sweden

* Replication file for the appendix analysis


* save all replication files in the same folder structure
* change the working directory to the designated folder structure
*cd "C:\..."


* Appendix B
* Figure B1
use "Accommodation_failure_party_cue.dta", clear

set scheme s1mono
* Histograms
hist eu_dissent if mainstream_narrow == 1 & wecee14 == 1
graph save hist1, replace
hist eu_position_change_rev if mainstream_narrow == 1 & wecee14 == 1
graph save hist2, replace

graph combine "hist1" "hist2"

graph export "FigureB1.png", replace

* Table B1
use "Accommodation_failure_election_level_data.dta", clear

eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

keep if e(sample) == 1

asdoc sum pervote eu_dissent eu_position_change_rev government eu_salience_change vote_lag, label replace dec(2) save(Table 1)

* Table B2
use "Accommodation_failure_dyadic_level_data.dta", clear

mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

asdoc sum vote_switch2 eu_dissent eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm, label replace dec(2) save(1) 


* Appendix C
* Table C1
use "Accommodation_failure_election_level_data.dta", clear 

eststo clear

eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

esttab using TableC1.rtf, replace label varwidth(22) modelwidth(5) compress nogap onecell se stats(N, fmt(a2) label ("Observations")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Vote") note("Notes: Panel regression models with party fixed effects and two-way clustered standard errors at the party and election level; Dependent variable: Vote percentage") b(%9.3fc) order(vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change) 


* Figure C1
use "Accommodation_failure_election_level_data.dta", clear 

set scheme s1mono

* Checking the linearity assumption
interflex pervote eu_position_change_rev eu_dissent government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, cluster(election_id) fe(party_id) ylab(mainstream vote) dlab(Δ EU position) xlab(EU intra-party divisions) title("(A) Binned estimator")

graph save g1, replace 

use "Accommodation_failure_election_level_data.dta", clear 

* Checking the linearity assumption
interflex pervote eu_position_change_rev eu_dissent government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, type(kernel) cluster(election_id) fe(party_id) ylab(mainstream vote) dlab(Δ EU position) xlab(EU intra-party divisions) bw(8.9125) title("(B) Kernel estimator")

graph save g2, replace 

graph combine "g1" "g2"

graph export "FigureC1.png", replace

* C2
use "Accommodation_failure_election_level_data.dta", clear 

set scheme plotplain

* main model with all mainstream parties and country FEs + country-clustered standard errors
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo Krause_2020
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(country)
eststo Meijers_Williams_2020
eststo: reghdfe vote_change_ches vote_change_lag_ches eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id)
eststo Adams_et_al_2006
eststo: reghdfe vote_change_ches vote_change_lag_ches eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, noabsorb
eststo Adams_SomerTopcu_2009
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id)
eststo vanSpanje_deGraaf_2018
eststo: reghdfe vote_change_ches eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(country) cluster(election_id)
eststo Krause_et_al_2023
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(election_id party_id) cluster(party_id election_id)
eststo election_FEs
* alternative mainstream definition
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo alternative_mainstream
* lagged position and salience control
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change eu_position2_rev_lag eu_salience_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo lagged_controls

coefplot Krause_2020 Meijers_Williams_2020 Adams_et_al_2006 Adams_SomerTopcu_2009 vanSpanje_deGraaf_2018 Krause_et_al_2023 election_FEs alternative_mainstream lagged_controls, bylabel(effect on vote) ||, xline(0, lpattern(dash) lcolor(red)) xsc(r(-.6 .1)) xlab(-.6 (0.1) 0.1) keep(c.eu_dissent#c.eu_position_change_rev) legend(pos(6) row(3))  byopts(cols(3) xrescale legend(off) title("CCS divisions indicator", size(medium))) levels(90) mlabel(cond(@pval<.001, string(@b, "%9.2fc") + "***", ///
cond(@pval<.01, string(@b, "%9.2fc") + "**" , ///
cond(@pval<.05, string(@b, "%9.2fc") + "*"  , ///
cond(@pval<.1, string(@b, "%9.2fc") + "+", ///
string(@b, "%9.2fc")))))) ///
mlabposition(12) grid(none) color(blue) ciopts(lcolor(dknavy))caption("90% CIs; + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001", position(5) justification(right) size(vsmall)) 

graph export "FigureC2.png", replace

* Figure C3
use "Accommodation_failure_election_level_data.dta", clear

set scheme plotplain

// specification reported by Krause (2020), party FEs with election and party clusters
reghdfe pervote vote_lag eu_dissent eu_position_change_rev_rel c.eu_dissent#c.eu_position_change_rev_rel government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
keep if e(sample) == 1

margins, dydx(eu_position_change_rev_rel) at(eu_dissent=(0(0.5)10))
marginsplot, ytitle(Marginal effect of relative Δ EU position on mainstream vote, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title("") level(90) yline(0) note("90% CIs", pos(5) size(vsmall)) ///
addplot(hist eu_dissent, yscale(r(-3 0) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-4(1)2) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph export "FigureC3.png", replace

* C4
use "Accommodation_failure_election_level_data.dta", clear

set scheme plotplain

* Jackknife by country
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo base
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 1, absorb(party_id) cluster(party_id election_id)
eststo no_bel
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 2, absorb(party_id) cluster(party_id election_id)
eststo no_dk
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 3, absorb(party_id) cluster(party_id election_id)
eststo no_ger
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 4, absorb(party_id) cluster(party_id election_id)
eststo no_gre
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 5, absorb(party_id) cluster(party_id election_id)
eststo no_esp
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 6, absorb(party_id) cluster(party_id election_id)
eststo no_fr
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 7, absorb(party_id) cluster(party_id election_id)
eststo no_ire
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 8, absorb(party_id) cluster(party_id election_id)
eststo no_ita
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 10, absorb(party_id) cluster(party_id election_id)
eststo no_nl
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 11, absorb(party_id) cluster(party_id election_id)
eststo no_uk
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 12, absorb(party_id) cluster(party_id election_id)
eststo no_por
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 13, absorb(party_id) cluster(party_id election_id)
eststo no_aus
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 14, absorb(party_id) cluster(party_id election_id)
eststo no_fin
eststo: reghdfe pervote vote_lag eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1 & country != 16, absorb(party_id) cluster(party_id election_id)
eststo no_swe

coefplot base no_bel no_dk no_ger no_gre no_esp no_fr no_ire no_ita no_nl no_uk no_por no_aus no_fin no_swe, bylabel(effect on vote) ||, xline(0, lpattern(dash) lcolor(red)) xsc(r(-.7 .1)) xlab(-.7 (0.1) 0.1) keep(c.eu_dissent#c.eu_position_change_rev) legend(pos(6) row(3))  byopts(cols(3) xrescale legend(off) title("", size(medium))) levels(90) mlabel(cond(@pval<.001, string(@b, "%9.2fc") + "***", ///
cond(@pval<.01, string(@b, "%9.2fc") + "**" , ///
cond(@pval<.05, string(@b, "%9.2fc") + "*"  , ///
cond(@pval<.1, string(@b, "%9.2fc") + "+", ///
string(@b, "%9.2fc")))))) ///
mlabposition(12) grid(none) color(blue) ciopts(lcolor(dknavy)) caption("90% CIs; + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001", position(5) justification(right) size(vsmall)) 

graph export "FigureC4.png", replace

* Table C3

use "Accommodation_failure_election_level_data.dta", clear

eststo clear
eststo: reghdfe eu_dissent eu_position_change_rev government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo: reghdfe eu_dissent eu_position_change_rev_lag government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

eststo: reghdfe eu_public_supp_rev eu_position_change_rev government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo: reghdfe eu_public_supp_rev eu_position_change_rev_lag government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

eststo: reghdfe eu_public_supp_div eu_position_change_rev government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo: reghdfe eu_public_supp_div eu_position_change_rev_lag government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

esttab using TableC3.rtf, replace label varwidth(18) modelwidth(5) compress nogap onecell se stats(N, fmt(a2) label ("Observations")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("EU divisions" "EU divisions" "EU supporter attitudes" "EU supporter attitudes" "EU supporter divisions" "EU supporter divisions") note("Notes: Panel regression models with party fixed effects and two-way clustered standard errors at the party and election level; Dependent variable: Models 1 and 2 = EU intra-party divisions; models 3 and 4 = Supporter attitudes; models 5 and 6 = Supporter EU attitude heterogeneity") b(%9.3fc) order(eu_position_change_rev eu_position_change_rev_lag government eu_salience_change vote_lag) 

* Table C4
* Testing endogeneity part 2

use "Accommodation_failure_election_level_data.dta", clear

eststo clear
* main model with all mainstream parties and country FEs + country-clustered standard errors
eststo: reghdfe eu_position_change_rev eu_public_change_rev_ees government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo: reghdfe eu_position_change_rev eu_public_supp_change_rev_ees government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

eststo: reghdfe eu_dissent eu_public_change_rev_ees government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo: reghdfe eu_dissent eu_public_supp_change_rev_ees government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

eststo: reghdfe pervote eu_public_change_rev_ees government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
eststo: reghdfe pervote eu_public_supp_change_rev_ees government eu_salience_change vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)

esttab using TableC4.rtf, replace label varwidth(22) modelwidth(5) compress nogap onecell se stats(N, fmt(a2) label ("Observations")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "EU divisions" "EU divisions" "Vote share" "Vote share") note("Notes: Panel regression models with party fixed effects and two-way clustered standard errors at the party and election level; Dependent variable: Models 1 and 2 = Δ EU position; models 3 and 4 = EU intra-party divisions; models 5 and 6 = Vote share") b(%9.3fc) order(eu_public_change_rev_ees eu_public_supp_change_rev_ees government eu_salience_change vote_lag) 


* Appendix D
* Table D1
use "Accommodation_failure_dyadic_level_data.dta", clear

eststo clear

* party model
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
* party-system controls
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
* election-level controls
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:

esttab using TableD1.rtf, replace label varwidth(25) modelwidth(8) compress nogap onecell se stats(N, fmt(a2) label ("Observations")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Party controls" "Party system controls" "Election controls") note("Notes: Multilevel regression models with random intercepts at the country, election, and party-election level; Dependent variables: Total dyadic vote gains as share of the electorate") b(%9.3fc) order(eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm)  

* Figure D1
use "Accommodation_failure_dyadic_level_data.dta", clear

set scheme plotplain

* base model
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
eststo base
* time component linear
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm year if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
eststo time_linear
* time component eurozone
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm eurozone_crisis if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
eststo eurozone_crisis
* alternative mainstream definition
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream == 1 || country2: || election_id: || party_election_id:
eststo alternative_mainstream
* lagged controls
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm eu_position2_rev_lag eu_salience_lag if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
eststo lagged_controls
* excluding
mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & party_idB != 0 || country2: || election_id: || party_election_id:
eststo parties_only
* reghdfe
eststo: reghdfe vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change if mainstream_narrow == 1 , absorb(election_id) cluster(party_election_id)
eststo election_FEs

coefplot base time_linear eurozone_crisis alternative_mainstream lagged_controls parties_only election_FEs, bylabel(effect on vote) ||, xline(0, lpattern(dash) lcolor(red)) xsc(r(-.2 .1)) xlab(-.2 (0.1) 0.1) keep(c.eu_dissent#c.eu_position_change_rev) legend(pos(6) row(3)) byopts(cols(3) xrescale legend(off) title("", size(medium))) levels(90) mlabel(cond(@pval<.001, string(@b, "%9.2fc") + "***", ///
cond(@pval<.01, string(@b, "%9.2fc") + "**" , ///
cond(@pval<.05, string(@b, "%9.2fc") + "*"  , ///
cond(@pval<.1, string(@b, "%9.2fc") + "+", ///
string(@b, "%9.2fc")))))) ///
mlabposition(12) grid(none) color(blue) ciopts(lcolor(dknavy)) caption("90% CIs; + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001", position(5) justification(right) size(vsmall)) 

graph export "FigureD1.png", replace


* Figure D2
use "Accommodation_failure_dyadic_level_data.dta", clear

eststo clear
set scheme plotplain

mixed vote_switch3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(Marginal effect of Δ EU position on relative dyadic vote gains, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title("") level(90) yline(0) note("90% CIs", pos(5) size(vsmall)) ///
addplot(hist eu_dissent, yscale(r(-12 12) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-12(4)12) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph export "FigureD2.png", replace

* Figure D3
use "Accommodation_failure_dyadic_level_data.dta", clear

eststo clear
set scheme plotplain


* Jackknife by country
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
eststo base
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 0  & country != 1  || country2: || election_id: || party_election_id:
eststo no_bel
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 2 || country2: || election_id: || party_election_id:
eststo no_dk
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 3 || country2: || election_id: || party_election_id:
eststo no_ger
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 4 || country2: || election_id: || party_election_id:
eststo no_gre
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 5 || country2: || election_id: || party_election_id:
eststo no_esp
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 6 || country2: || election_id: || party_election_id:
eststo no_fr
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 7 || country2: || election_id: || party_election_id:
eststo no_ire
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 8 || country2: || election_id: || party_election_id:
eststo no_ita
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 10 || country2: || election_id: || party_election_id:
eststo no_nl
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 11 || country2: || election_id: || party_election_id:
eststo no_uk
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 12 || country2: || election_id: || party_election_id:
eststo no_por
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 13 || country2: || election_id: || party_election_id:
eststo nous
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 14 || country2: || election_id: || party_election_id:
eststo no_fin
eststo: mixed vote_switch2 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & country != 16 || country2: || election_id: || party_election_id:
eststo no_swe

coefplot base no_bel no_dk no_ger no_gre no_esp no_fr no_ire no_ita no_nl no_uk no_por nous no_fin no_swe, bylabel(effect on vote) ||, xline(0, lpattern(dash) lcolor(red)) xsc(r(-.2 .1)) xlab(-.2 (0.1) 0.1) keep(c.eu_dissent#c.eu_position_change_rev) legend(pos(6) row(3)) byopts(cols(3) xrescale legend(off) title("", size(medium))) levels(90) mlabel(cond(@pval<.001, string(@b, "%9.2fc") + "***", ///
cond(@pval<.01, string(@b, "%9.2fc") + "**" , ///
cond(@pval<.05, string(@b, "%9.2fc") + "*"  , ///
cond(@pval<.1, string(@b, "%9.2fc") + "+", ///
string(@b, "%9.2fc")))))) ///
mlabposition(12) grid(none) color(blue) ciopts(lcolor(dknavy)) caption("90% CIs; + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001", position(5) justification(right) size(vsmall)) 

graph export "FigureD3.png", replace

* Figure D4
use "Accommodation_failure_dyadic_level_data.dta", clear

eststo clear
set scheme plotplain

mixed voter_retention3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(ME of Δ EU position on dyadic voter retention, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title((A) Voter retention, size(med)) level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(-8 6) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-8(2)6) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph save g1, replace

use "Accommodation_failure_dyadic_level_data.dta", clear

eststo clear
set scheme plotplain

mixed voter_retention3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & eurosceptic_dyad == 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(ME of Δ EU position on dyadic voter retention, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title((B) Voter retention vs. Eurosceptic, size(med)) level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(-8 6) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-8(2)6) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph save g2, replace

use "Accommodation_failure_dyadic_level_data.dta", clear

eststo clear
set scheme plotplain

mixed voter_retention3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & eurosceptic_dyad != 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(ME of Δ EU position on dyadic voter retention, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title((C) Voter retention vs. non-Eurosceptic, size(med)) level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(-8 6) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-8(2)6) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph save g3, replace

graph combine "g1" "g2" "g3", note("90% CIs", pos(5) size(vsmall)) row(2)

graph export "FigureD4.png", replace

* Figure D5
use "Accommodation_failure_dyadic_level_data.dta", clear

mixed voter_attraction3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(ME of Δ EU position on dyadic voter attraction, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title((B) Voter attraction, size(med)) level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(-12 12) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-12(4)12) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph save g1, replace

use "Accommodation_failure_dyadic_level_data.dta", clear

mixed voter_attraction3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1  & eurosceptic_dyad == 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(ME of Δ EU position on dyadic voter attraction, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title((B) Voter attraction vs. Eurosceptic, size(med)) level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(-12 12) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-12(4)12) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph save g2, replace

use "Accommodation_failure_dyadic_level_data.dta", clear

mixed voter_attraction3 eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government vote_lag eu_salience_change avg_pos_eu_rev_change avg_sal_eu_change gdp_cap_growth_lag1 unemployment_lag1 eff_parties_corr adm if mainstream_narrow == 1 & eurosceptic_dyad != 1 || country2: || election_id: || party_election_id:
keep if e(sample) == 1

margins, dydx(eu_position_change_rev) at(eu_dissent=(0(1)10))
marginsplot, ytitle(ME of Δ EU position on dyadic voter attraction, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title((C) Voter attraction vs. non-Eurosceptic, size(med)) level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(-12 12) axis(1)) ylab(0(0.2)1, axis(2)) ylab(-12(4)12) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off))

graph save g3, replace

graph combine "g1" "g2" "g3", note("90% CIs", pos(5) size(vsmall)) row(2)

graph export "FigureD5.png", replace

* Figure E1
use "Accommodation_failure_party_like.dta", clear

set scheme plotplain
eststo clear

reghdfe party_like eu_dissent eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
keep if e(sample) == 1
margins, at(eu_dissent=(0(1)10))
marginsplot, ytitle(Predicted party likeabilityy, size(small)) xtitle(EU intra-party divisions) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title("") level(90) yline(0) ///
addplot(hist eu_dissent, yscale(r(4 5.5) axis(1)) ylab(0(0.2)1, axis(2)) ylab(4(0.5)5.5) ///
xlabel(0(1)10) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off) ytitle("Distribution of EU intra-party divisions", axis(2) size(small)))

graph save "g1", replace

use "Accommodation_failure_party_like.dta", clear

reghdfe party_like eu_dissent eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
keep if e(sample) == 1
margins, at(eu_position_change_rev=(-3(1)4))
marginsplot, ytitle(Predicted party likeabilityy, size(small)) xtitle(Δ EU position) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title("") level(90) yline(0) ///
addplot(hist eu_position_change_rev, yscale(r(4 5.5) axis(1)) ylab(0(0.2)1, axis(2)) ylab(4(0.5)5.5) ///
xlabel(-3(1)4) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off) ytitle("Distribution of Δ EU position", axis(2) size(small)))

graph save "g2", replace

graph combine "g1" "g2", note("90% CIs", pos(5) size(vsmall))


graph export "FigureE1.png", replace

* Table E1

use "Accommodation_failure_party_like.dta", clear

label variable eu_salience_change "Δ EU salience"
label variable government "Government"
label variable eu_dissent "EU divisions"
label variable eu_position_change_rev "Δ EU position"

eststo clear
* main model with all mainstream parties and country FEs + country-clustered standard errors
eststo: reghdfe party_like eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(election_id party_id)

esttab using TableE1.rtf, replace label varwidth(26) modelwidth(10) compress nogap onecell se stats(N, fmt(a2) label ("Observations")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Party likeability") note("Notes: Panel regression models with party fixed effects and two-way clustered standard errors at the party and election level; Dependent variable: Party likeability") b(%9.3fc) order(eu_dissent eu_position_change_rev c.eu_dissent#c.eu_position_change_rev government eu_salience_change) 

* Figure E2
use "Accommodation_failure_party_like.dta", clear

reghdfe vote party_like government vote_lag if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(party_id election_id)
keep if e(sample) == 1
margins, at(party_like=(2(1)7))
marginsplot, ytitle(Predicted vote percentage, size(small)) xtitle(Party likeability) recast(line) recastci(rarea) ci1opt(fcolor(midblue%40) lcolor(midblue%40)) title("") level(90) yline(0) ///
addplot(hist party_like, yscale(r(0 40) axis(1)) ylab(0(0.2)1, axis(2)) ylab(0(10)40) ///
xlabel(2(1)7) yaxis(2) ysc(axis(2) off alt) ///
fcolor(dkgreen%30) lcolor(dkgreen%30) legend(off) ytitle("Distribution of Δ EU position", axis(2) size(small))) note("90% CIs", pos(5) size(vsmall))

graph export "FigureE2.png", replace

* Table E2
use "Accommodation_failure_party_cue.dta", clear

eststo clear
eststo: reghdfe eu_public_change_rev_ees eu_position_change_rev eu_dissent c.eu_position_change_rev#c.eu_dissent government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(election_id party_id)
eststo: reghdfe eu_public_supp_change_rev_ees eu_position_change_rev eu_dissent c.eu_position_change_rev#c.eu_dissent government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, absorb(party_id) cluster(election_id party_id)

esttab using TableE2.rtf, replace label varwidth(26) modelwidth(10) compress nogap onecell se stats(N, fmt(a2) label ("Observations")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ Voter EU position" "Δ Supporter EU position") note("Notes: Panel regression models with party fixed effects and two-way clustered standard errors at the party and election level; Dependent variable: Δ mean voter EU position (model 1) and Δ mean supporter EU position (model 2)") b(%9.3fc) order(eu_dissent eu_position_change_rev c.eu_position_change_rev#c.eu_dissent government eu_salience_change) 

* Figure E3
use "Accommodation_failure_party_like.dta", clear

set scheme s1mono

* Checking the linearity assumption
interflex party_like eu_position_change_rev eu_dissent government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, cluster(election_id) fe(party_id) ylab(party likeability) dlab(Δ EU position) xlab(EU intra-party divisions) title("(A) Binned estimator")

graph save g1, replace 

use "Accommodation_failure_party_like.dta", clear

* Checking the linearity assumption
interflex party_like eu_position_change_rev eu_dissent government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, type(kernel) cluster(election_id) fe(party_id) ylab(party likeability) dlab(Δ EU position) xlab(EU intra-party divisions) bw(7.3182) title("(B) Kernel estimator")

graph save g2, replace 

graph combine "g1" "g2"

graph export "FigureE3.png", replace


* Figure E4
use "Accommodation_failure_party_cue.dta", clear

set scheme s1mono

* Checking the linearity assumption
interflex eu_public_supp_change_rev_ees eu_position_change_rev eu_dissent government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, cluster(election_id) fe(party_id) ylab(Δ EU supporter position) dlab(Δ EU position) xlab(EU intra-party divisions) title("(A) Binned estimator")

graph save g1, replace 

use "Accommodation_failure_party_cue.dta", clear

* Checking the linearity assumption
interflex eu_public_supp_change_rev_ees eu_position_change_rev eu_dissent government eu_salience_change if mainstream_narrow == 1 & wecee14 == 1, type(kernel) fe(party_id) cluster(election_id)  ylab(Δ EU supporter position) dlab(Δ EU position) xlab(EU intra-party divisions) bw(2) title("(B) Kernel estimator")

graph save g2, replace 

graph combine "g1" "g2"

graph export "FigureE4.png", replace
